db32289c7b5bbc3e02cfc16c977a22cd8013c0e5,src/net/rithms/riot/api/LeagueApi.java,LeagueApi,getLeagueByTeams,#Region#String#String#,70
Before Change
}
public static Map<String, List<League>> getLeagueByTeams(Region region, String key, String teamIds) throws RiotApiException {
String url = region.getEndpoint() + VERSION + "league/by-team/" + teamIds + "?api_key=" + key;
Map<String, List<League>> leagues = null;
try {
leagues = new Gson().fromJson(Request.sendGet(url), new TypeToken<Map<String, List<League>>>() {
}.getType());
} catch (JsonSyntaxException e) {
throw new RiotApiException(RiotApiException.PARSE_FAILURE);
}
if (leagues == null) {
throw new RiotApiException(RiotApiException.PARSE_FAILURE);
}
return leagues;
After Change
return dto;
}
public static Map<String, List<League>> getLeagueByTeams(Region region, String key, String teamIds) throws RiotApiException {
Request request = new Request();
request.addToUrl(region.getEndpoint(), VERSION, "league/by-team/", teamIds, "?api_key=", key);
request.execute();
Map<String, List<League>> dto = request.getDto(new TypeToken<Map<String, List<League>>>() {
}.getType());
return dto;
}